//
//  CarIconScrollView.m
//  WWXELuShang
//
//  Created by 王涛 on 15/12/18.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CarIconScrollView.h"
@implementation CarIconScrollView

- (instancetype)initWithFrame:(CGRect)frame imageArray:(NSMutableArray *)imageArray{
    self = [super initWithFrame:frame];
    if (self) {
        self.contentSize = CGSizeMake(imageArray.count * kWidth, 0);
//        self.bounces = NO;//回弹；
        self.pagingEnabled = YES;
        self.contentOffset = CGPointMake(kWidth, 0);
//        self.showsHorizontalScrollIndicator = NO;
        
        for (int i = 0; i < imageArray.count; i ++) {
            UIImageView *imageView = imageArray[i];
            imageView.frame = CGRectMake(i * kWidth, 0, kWidth, self.bounds.size.height);
            [self addSubview:imageView];
        }
    }
    return self;
}

@end
